﻿using App.Common;
using QxFramework.Core;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class BattleUI : UIBase
{
    public override void OnDisplay(object args)
    {
        base.OnDisplay(args);
        CollectObject();
        _gos["End"].GetComponent<Button>().onClick.RemoveAllListeners();
        _gos["End"].GetComponent<Button>().onClick.AddListener(()=> {
            GameMgr.Get<IBattleManager>().EndThisTurn();
        });
    }
    private void Update()
    {
        _gos["End"].SetActive(!GameMgr.Get<IBattleManager>().GetBattleData().BlockInput
            && GameMgr.Get<IBattleManager>().GetBattleData().monos[GameMgr.Get<IBattleManager>().GetBattleData().CurrentID].Contains("Player"));
        if (!GameMgr.Get<IBattleManager>().GetBattleData().InBattle)
        {
            UIManager.Instance.Close(this);
        }
    }
}
